#coding=utf-8
'''
Created on 2017-04-20

@author: sandy
'''

from pycommon import Pack as packet
from pycommon import Const
from pycommon import Utils

def registerResult(code,account='',passwd=''):
    return packet.pack("HHss",Const.CMD_L2C_REGISTER,code,account,passwd)

def loginResult(code,uid,session):
    return packet.pack("HHIs",Const.CMD_L2C_LOGIN,code,uid,Utils.u2pstr(session))

def gateInfo(code,gateInfo):
    return packet.pack("HHs",Const.CMD_L2C_GATE_INFO,code,gateInfo)

def loginWeChatResult(nickname,headimgurl,sex):
    return packet.pack("HsSB",Const.CMD_L2C_WX_LOGIN,Utils.u2pstr(nickname),Utils.u2pstr(headimgurl),sex)




